#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define LIM 10
char *s_gets(char *,int);

int main(){
    char number[LIM];
    char *end;
    long value;
    while(s_gets(number,LIM) && number[0]!='\0'){
        value=strtol(number,&end,35);
        printf("%ld,%s,%d",value,end,*end);
    }
}

char *s_gets(char *str,int n){
    char *ret_val;
    int st=0;
    ret_val=fgets(str,n,stdin);
    if(ret_val){
        int i=0;
        while(str[i]!='\n' && str[i]!='\0'){
            i++;
        }
        if(str[i]=='\n'){
            str[i]='\0';
        }else{
            while(getchar()!='\n'){
                continue;
            }
        }
    }
    return ret_val;
}

/*

*/